package control;

import java.io.IOException;
import java.util.List;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;

import model.Aluno;
import model.DAOAluno;
import model.Turma;

public class ListarTumasDisponiveisTag extends SimpleTagSupport {
	
	private Aluno a;
	
	public void doTag ()throws JspException, IOException {
		DAOAluno daoal = new DAOAluno();
		List<Turma> turmas = daoal.findTurmasDisponiveis(a);
		getJspContext().setAttribute("turmas", turmas);
		getJspBody().invoke(null);
	}
	
	public void setId(Aluno id) { 
		this.a = id; 
	}
}
